const config = require("../config");
const model = require("../model");
const Result = model.Result;

module.exports = {
  create: async (resultData) => {
    let result = await Result.create(resultData);
    if (result) {
      return {
        "result": true,
        "data": result
      };
    } else return { "result": false, }
  },
  getByTableId: async (tableId) => {
    let result = await Result.findAll({
      where: { tableId: tableId }
    });
    if (result) {
      return {
        "result": true,
        "data": result
      };
    } else return { "result": false, }
  },
}